﻿using Appliaction.Dto.DB;
using Domain.Entitys.DB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Appliaction.IAppServices.DB
{
    /// <summary>
    /// Appliaction库位服务接口
    /// </summary>
    public interface IDb_warehouse_locationServices
    {
        /// <summary>
        /// 库位分页查询
        /// </summary>
        /// <param name="location_code">编码</param>
        /// <param name="location_name">名称</param>
        /// <param name="location_x_position">库位位置X</param>
        /// <param name="location_y_position">库位位置Y</param>
        /// <param name="location_z_position">库位位置Z</param>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">查询条数</param>
        /// <returns></returns>
        List<Warehouse_location> Select_fy_warehouse_zone(string zone_code, string location_code, string location_name, int location_x_position, int location_y_position, int location_z_position, int currentPage, int pageSize);

        /// <summary>
        /// 查询总条数
        /// </summary>
        /// <param name="warehouse_name"></param>
        /// <returns></returns>
        int Select_count_warehouse_zone(string zone_code, string location_code, string location_name, int location_x_position, int location_y_position, int location_z_position);

        /// <summary>
        /// 仓库库位修改冻结状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="Warehouse_freeze"></param>
        /// <returns></returns>
        Task<int> warehouse__location_Frozenstate(int id, char location_freeze);



        /// <summary>
        /// 库位编码唯一性判断
        /// </summary>
        /// <param name="warehouse_code"></param>
        /// <returns></returns>
        Task<int> Warehouse_Location_code_judgment(string location_code, string zone_code);

        /// <summary>
        /// 库位名称唯一性判断
        /// </summary>
        /// <param name="warehouse_code"></param>
        /// <returns></returns>
        Task<int> Warehouse_Location_name_judgment(string location_name, string zone_code);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="db_Warehouse_LocationAddDto"></param>
        /// <returns></returns>
        Task<int> warehouse_location_Add(Db_Warehouse_locationAddDto db_Warehouse_LocationAddDto);



        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="id"></param>
        /// <param name="location_freeze"></param>
        /// <returns></returns>
        Task<int> warehouse__location_Update(Db_Warehouse_locationUpdateDto  db_Warehouse_LocationUpdateDto);



        /// <summary>
        /// 逻辑删除库位
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<int> warehouse_location_tombstone(string zone_code, string location_code);


        /// <summary>
        /// 查询库位
        /// </summary>
        /// <param name="warehouse_code"></param>
        /// <returns></returns>
        List<Warehouse_location> warehouse_location_Async(string zone_code);


        /// <summary>
        /// 判断库位的添加是否大于库区的容量
        /// </summary>
        /// <param name="warehouse_code"></param>
        /// <param name="zone_capacity"></param>
        /// <returns></returns>
        Task<int> Warehouselocation_Capacity_judgment(string zone_code, int location_max_capacity);

        /// <summary>
        /// 结构编码查询仓库信息
        /// </summary>
        /// <param name="warehouse_code"></param>
        /// <returns></returns>
        List<Warehouse_location> Warehouse_location_By_Select_Async_code(string zone_code, string location_code);


        /// <summary>
        /// 修改查询仓库名称
        /// </summary>
        /// <param name="location_name"></param>
        /// <param name="zone_code"></param>
        /// <param name="location_code"></param>
        /// <returns></returns>
        Task<int> Warehouse_Location_name_UpdateJudgment(string location_name, string zone_code, string location_code);



        /// <summary>
        /// 修改的容量判断
        /// </summary>
        /// <param name="zone_code"></param>
        /// <param name="location_code"></param>
        /// <param name="new_location_max_capacity"></param>
        /// <returns></returns>
        Task<int> Warehouselocation_Capacity_UpdateJudgment(string zone_code, string location_code, int new_location_max_capacity);
    }
}
